package com.ktwlsoft.archivemanage.domain.business.repositoryService.businessInspect;

import java.util.List;

import com.ktwlsoft.archivemanage.domain.dao.entity.businessInspect.InspectSubjectItem;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ktwlsoft.archivemanage.domain.dao.repository.businessInspect.IInspectSubjectItemMapper;

/**
 * inspect_subject_item--业务检查题目选项业务层接口实现类
 *
 * @author zhuhe on 2019-11-12 15:00:46
 * @version 1.0
 */
@Service
public class InspectSubjectItemRepositoryService {

	private final IInspectSubjectItemMapper InspectSubjectItemMapper;

	public InspectSubjectItemRepositoryService(IInspectSubjectItemMapper InspectSubjectItemMapper) {
		this.InspectSubjectItemMapper = InspectSubjectItemMapper;
	}

	/**
 	 * 查询分页 on 2019-11-12 15:00:46
 	 * @param pn 第几页
     * @param pageSize 每页多少条
 	 * @param inspectSubjectItem inspectSubjectItem
 	 * @return PageInfo<InspectSubjectItem>
 	 */
	public PageInfo<InspectSubjectItem> findPage(int pn, int pageSize, InspectSubjectItem inspectSubjectItem) {
		PageHelper.startPage(pn,pageSize);
		PageInfo<InspectSubjectItem> pageInfo = new PageInfo<InspectSubjectItem>(InspectSubjectItemMapper.findList(inspectSubjectItem));
		return pageInfo;
	}

    /**
	 * 查询集合 on 2019-11-12 15:00:46
	 * @param inspectSubjectItem inspectSubjectItem
	 * @return List<InspectSubjectItem>
	 */
	public List<InspectSubjectItem> findList(InspectSubjectItem inspectSubjectItem) {
		return InspectSubjectItemMapper.findList(inspectSubjectItem);
	}

    /**
	 * 根据ID查询信息 on 2019-11-12 15:00:46
	 * @param id	主键
	 * @return InspectSubjectItem
	 */
	public InspectSubjectItem getById(Long id){
		return InspectSubjectItemMapper.getById(id);
	}

	/**
	 * 根据题目ID查询信息 on 2019-11-12 15:00:46
	 * @param subjectId	题目ID
	 * @return InspectSubjectItem
	 */
	public List<InspectSubjectItem> getBySubjectId(Long subjectId){
		return InspectSubjectItemMapper.getBySubjectId(subjectId);
	}

   /**
	 * 新增 on 2019-11-12 15:00:46
	 * @param inspectSubjectItem inspectSubjectItem
	 * @return int
	 */
	public int insert(InspectSubjectItem inspectSubjectItem){
		return InspectSubjectItemMapper.insert(inspectSubjectItem);
	}

	/**
	 * 批量插入 on 2019-04-23 10:57:02
	 * @param list list
	 * @return int
	 */
	public int manyInsert(List<InspectSubjectItem> list){
		return InspectSubjectItemMapper.manyInsert(list);
	}

   /**
	 * 修改 on 2019-11-12 15:00:46
	 * @param inspectSubjectItem inspectSubjectItem
	 * @return int
	 */
	public int update(InspectSubjectItem inspectSubjectItem){
		return InspectSubjectItemMapper.update(inspectSubjectItem);
	}

   /**
	 * 根据id集合批量删除信息 on 2019-11-12 15:00:46
	 * @param guidanceSubjectItemArr	主键编号集合
	 * @return int
	 */
	public int deleteByIds(List<Long> guidanceSubjectItemArr){
		return InspectSubjectItemMapper.deleteByIds(guidanceSubjectItemArr);
	}

   /**
	 * 根据id删除信息 on 2019-11-12 15:00:46
	 * @param id id
	 * @return int
	 */
	public int deleteById(Long id){
		return InspectSubjectItemMapper.deleteById(id);
	}
}
